/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Configuration.Provider;

namespace DaveSexton.DocProject.DocSites
{
	[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")]
	public sealed class DocSiteSearchProviderCollection : ProviderCollection
	{
		#region Public Properties
		public new DocSiteSearchProvider this[string name]
		{
			get
			{
				return (DocSiteSearchProvider) base[name];
			}
		}
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="DocSiteSearchProviderCollection" /> class.
		/// </summary>
		public DocSiteSearchProviderCollection()
		{
		}
		#endregion

		#region Methods
		public override void Add(ProviderBase provider)
		{
			if (provider == null)
				throw new ArgumentNullException("provider");

			if (!(provider is DocSiteSearchProvider))
				throw new ArgumentException(Resources.Errors.InvalidSearchProviderType, "provider");

			base.Add(provider);
		}
		#endregion
	}
}
